package com.bnlr.lrparking.widget;

/**
 * 转换器
 */

public class ConvertHelper {
    /**
     * 转换为String
     * @return
     */
    public static String convertToString (Object content) {
        try {
            if (content == null) {
                return "";
            }
           return String.valueOf(content);
        } catch (Exception e) {
            return "";
        }
    }
    /**
     * 转换为Double
     * @return
     */
    public static Double convertToDouble (Object content) {
        try {
            if (content instanceof String) {
                return Double.valueOf((String) content);
            }
            return Double.valueOf((Double) content);
        } catch (Exception e) {
            return Double.valueOf(0);
        }
    }
}
